﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace SistemaInventarioMVC.Models.Entidades
{
    [Table("CabeceraEntradaAlmacen")]
    public class CabeceraEntradaAlmacen
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Int32 EntradaAlmacenID { get; set; }

        [Column]
        [Display(Name="Razon de entrada")]
        public Int32 RazonEntradaID { get; set; }

        [Column]
        [Display(Name="Fecha de entrada")]
        public DateTime FechaEntrada { get; set; }

        [Column]
        [StringLength(20)]
        [Display(Name="Nro de Orden")]
        public String NroOrden { get; set; }

        [Column]
        [StringLength(40)]
        public String Suplidor { get; set; }

        [Column]
        [StringLength(40)]
        [Display(Name="Factura")]
        public String Factura { get; set; }

        [Column]
        [StringLength(50)]
        [Display(Name="Digitado por")]
        [Required(ErrorMessage="Este campo es requerido")]
        public String DigitadoPor { get; set; }

        [Column]
        [StringLength(50)]
        [Display(Name = "Revisado por")]
        [Required(ErrorMessage = "Este campo es requerido")]
        public String RevisadorPor { get; set; }

        [Column]
        [StringLength(50)]
        [Display(Name = "AprobadoPor")]
        [Required(ErrorMessage = "Este campo es requerido")]
        public String AprobadoPor { get; set; }

        //Propiedades de navegacion
        [ForeignKey("RazonEntradaID")]
        public virtual RazonEntrada RazonEntrada { get; set; }

        public virtual ICollection<DetalleEntradaAlmacen> DetalleEntradaAlmacen { get; set; }
    }
}